package com.cskaoyan.bean;

import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.Past;
import java.util.Date;

@Data
public class User {
    @Length(min = 6,max = 10)
    String username;
    @Length(min = 6,max = 10)
    String password;
    //最小值不能小于18，最大值不能大于70
    @Min(18)
    @Max(70)
    Integer age;
    //必须是过去的时间
    @Past
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    Date birthday;
}
